package com.iknow.activity;

import android.content.Intent;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.RadioGroup.OnCheckedChangeListener;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;
import com.iknow.util.Loger;

public class MyIKnowActivity extends MenuActivity
{
  private ImageView imgView;
  private TabHost mHost;
  private RadioGroup mRadioGroup;
  private Intent mRosterIntent;
  private Intent mUserIntent;

  private void initButton()
  {
    this.imgView = ((ImageView)findViewById(2131296438));
    this.mRadioGroup = ((RadioGroup)findViewById(2131296439));
    this.mRadioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener(this)
    {
      public void onCheckedChanged(, int paramInt)
      {
        int i = paramRadioGroup.indexOfChild((RadioButton)paramRadioGroup.findViewById(paramInt));
        MyIKnowActivity.access$0(this.this$0).setCurrentTab(i);
        if (i == 0)
          MyIKnowActivity.access$1(this.this$0).setBackgroundResource(2130837689);
        while (true)
        {
          do
            return;
          while (1 != i);
          MyIKnowActivity.access$1(this.this$0).setBackgroundResource(2130837692);
        }
      }
    });
  }

  private void initIntents()
  {
    this.mRosterIntent = new Intent(this, XmppContactsActivity.class);
    this.mUserIntent = new Intent(this, UserCenterActivity.class);
  }

  private void initTabPage()
  {
    TabHost.TabSpec localTabSpec1 = this.mHost.newTabSpec("roster");
    localTabSpec1.setContent(this.mRosterIntent);
    localTabSpec1.setIndicator("roster");
    this.mHost.addTab(localTabSpec1);
    TabHost.TabSpec localTabSpec2 = this.mHost.newTabSpec("user");
    localTabSpec2.setContent(this.mUserIntent);
    localTabSpec2.setIndicator("my_iknow");
    this.mHost.addTab(localTabSpec2);
  }

  protected void onActivityResult(int paramInt1, int paramInt2, Intent paramIntent)
  {
    Loger.d("MyIKnowActivity", "onActivityResult");
  }

  protected void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    requestWindowFeature(1);
    setContentView(2130903092);
    this.mHost = getTabHost();
    initIntents();
    initButton();
    initTabPage();
  }
}